<?php

namespace app\api\controller;
use app\api\model\MiningArithmetical as MiningArithmeticalModel;

class MiningArithmetical extends Baek
{

    function getList(){
        $type  = $this->request->post('type', '', 'intval');  //获取矿机类型
        $where = [];
        switch ($type){
            case 1:
                $where['type'] = 1;
                break;
            case 2:
                $where['type'] = 2;
                break;
            default:
                $where[] = ['type','in',[1,2]];
                break;
        }
        $data = MiningArithmeticalModel::getListAll($where)->toArray();
        return api_success($data);
    }

}